﻿function QQChat_OnUpdate()

   local button1 = this:GetParent():GetName().."BottomButton"
   local frame1 = this:GetParent():GetName()

   if ( (getglobal(frame1)):AtBottom()) then
      if (getglobal(button1)):IsVisible() then
         getglobal(button1):Hide()
      end
   else
      getglobal(button1):Show()
   end

end


function QQChat_OnMouseWheel(chatframe, value)
   if ( value > 0 ) then
         chatframe:ScrollUp()
   elseif ( value < 0 ) then
         chatframe:ScrollDown()
   end
end

ChatFrameMenuButton:Hide()
local function hide (h)
	h:SetScript('OnShow', h.Hide)
	h:Hide() end

for i=1, 7 do
	local x = getfenv(0)
      local button1 = getglobal('ChatFrame'..i..'BottomButton');
      local frame1 = getglobal('ChatFrame'..i);
      button1:SetPoint("RIGHT", frame1, "RIGHT", 0, 0);
      button1:SetPoint("LEFT", frame1, "RIGHT", -32, 0);
      button1:SetPoint("TOP", frame1, "BOTTOM", 0, 28);
      button1:SetPoint("BOTTOM", frame1, "BOTTOM", 0, 0);
      button1:SetAlpha(.6);
	hide(x['ChatFrame'..i..'UpButton']);
	hide(x['ChatFrame'..i..'DownButton']);
end

ChatFrameEditBox:ClearAllPoints();
ChatFrameEditBox:SetPoint("BOTTOMLEFT", "ChatFrame1", "TOPLEFT", 0, 2)
ChatFrameEditBox:SetPoint("BOTTOMRIGHT", "ChatFrame1", "TOPRIGHT", 0, 2)
ChatFrameEditBox:SetAltArrowKeyMode(nil)

local r = ({ChatFrameEditBox:GetRegions()})
r[6]: SetAlpha(0)
r[7]: SetAlpha(0)
r[8]: SetAlpha(0)

ChatFrameEditBox:SetBackdrop({bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 16,
insets = {left = 4, right = 4, top = 4, bottom = 4}})
ChatFrameEditBox:SetBackdropColor(0, 0, 0, 0.50)

CHAT_SAY_GET = "%s: "
CHAT_YELL_GET = "%s: "
CHAT_GUILD_GET = "%s: "
CHAT_RAID_GET = "%s: "
CHAT_PARTY_GET = "%s: "
CHAT_OFFICER_GET = "%s: "
CHAT_RAID_LEADER_GET = "%s: "

if (GetLocale() == "zhCN") then
CHAT_WHISPER_GET ="%s 悄悄话: "
CHAT_WHISPER_INFORM_GET ="发送给 %s: "

elseif (GetLocale() == "deDE") then
CHAT_WHISPER_GET ="Von %s: "
CHAT_WHISPER_INFORM_GET ="Zu %s: "

elseif (GetLocale() == "frFR") then
CHAT_WHISPER_GET ="De %s :"
CHAT_WHISPER_INFORM_GET ="A %s :"

else
CHAT_WHISPER_GET ="From %s: "
CHAT_WHISPER_INFORM_GET ="To %s: "
end

